package edu.zju.gis.dbfg.model.etl;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
@NoArgsConstructor
public class OptionField implements Serializable {

    private String fieldName;
    private String fieldType;

    public OptionField(String str) {
        String[] items = str.split(",");
        this.fieldName = items[0];
        this.fieldType = items[1];
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof OptionField) {
            OptionField of = (OptionField) obj;
            return of.getFieldName().equals(this.fieldName);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return fieldName.hashCode();
    }

}